﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Management/Management.master" AutoEventWireup="true"
    CodeFile="ENewsPaperPublish.aspx.cs" Inherits="Management_ENewsPaperPublish" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <table style="width: 100%;">
        <tr>
            <td>
                <div class="Dialog" style=" width:400px;">
                    <div class="Title">
                        电子报刊列表
                    </div>
                    <div class="Content">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
                            DataKeyNames="ID" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None"
                            EmptyDataText="暂无报刊相关内容" AllowPaging="True">
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:TemplateField HeaderText="刊号" SortExpression="Order">
                                    <ItemTemplate>
                                        第
                                        <%# Eval("Order") %>
                                        期
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="发布日期" SortExpression="PublishDate">
                                    <ItemTemplate>
                                        <%# Eval("PublishDate") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="内容简介" SortExpression="Content">
                                    <ItemTemplate>
                                        [<a href="../enewspaper.aspx?id=<%# Eval("ID") %>" target="_blank">查看报刊</a>]
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Button ID="btn_Edit" runat="server" Text="编辑" 
                                            CommandArgument='<%# Eval("ID") %>' onclick="btn_Edit_Click" /></ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AvatarConnectionString %>"
                            
                            SelectCommand="SELECT [ID], [Content], [PublishDate], [Order] FROM [ENewsPaper] ORDER BY [Order] DESC">
                        </asp:SqlDataSource>
                    </div>
                </div>
                <div style="height: 3px;">
                </div>
                <asp:Button ID="btn_AddNew" runat="server" CssClass="Button" Text="发布电子报刊" OnClick="btn_AddNew_Click" />
                <div class="Dialog" id="panel_Edit" runat="server">
                    <div class="Title">
                        电子报刊
                    </div>
                    <div class="Content">
                        <table>
                            <tr>
                                <td style="vertical-align:top;">
                                    内容：</td>
                                <td>
                                    <FCKeditorV2:FCKeditor Height="400px" ID="txt_Content" runat="server">
                                    </FCKeditorV2:FCKeditor>
                                    <asp:HiddenField ID="txt_ID" runat="server" />
                                </td>
                            </tr>
                            <tr>
                                <td>
                                </td>
                                <td>
                                    <asp:Button ID="btn_Save" runat="server" Text="保存" CssClass="Button" 
                                        onclick="btn_Save_Click" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <br />
                <asp:Label ID="lbl_Error" EnableViewState="false" ForeColor="Red" runat="server"></asp:Label>
            </td>
        </tr>
    </table>
</asp:Content>
